/**
 * 
 */
package optimization.naturalOptimization.particleSwarmOptimization.neighborhood;

import optimization.IdentificationI;
import optimization.naturalOptimization.fitness.SimpleFitnessFunction;
import optimization.naturalOptimization.particleSwarmOptimization.ParticleSwarmOptimization;

/**
 * Provides the superclass for all pso topologies.
 * 
 * @author Kevin Wagner
 * @version 1.0
 */
public abstract class PSONeighborhood implements IdentificationI {

	private ParticleSwarmOptimization parentPSO;

	@SuppressWarnings({ "rawtypes" })
	private SimpleFitnessFunction fitness;

	/**
	 * Creates a new neighborhood for the given
	 * {@link ParticleSwarmOptimization}.
	 * 
	 * @param parentPSO
	 */
	public PSONeighborhood(ParticleSwarmOptimization parentPSO) {
		this.parentPSO = parentPSO;
		this.fitness = parentPSO.getFitness();
	}

	/**
	 * Sets the best position of the neighborhood.
	 */
	public abstract void setNeighborhoodbest();

	/**
	 * Returns the parent pso algorithm.
	 * 
	 * @return the parentPSO
	 */
	public ParticleSwarmOptimization getParentPSO() {
		return parentPSO;
	}

	/**
	 * Returns the fitness function to compare particles.
	 * 
	 * @return the fitness function.
	 */
	@SuppressWarnings({ "rawtypes" })
	public SimpleFitnessFunction getFitness() {
		return fitness;
	}

}
